namespace FineCollection.Intf
{
    /// <summary>
    /// Generic matrix (read only interface).
    /// </summary>
    /// <typeparam name="T">type of an item.</typeparam>
    public interface RMatrix<T>
    {
        /// <summary>
        /// The first X-index.
        /// </summary>
        int FirstX
        { 
            get;
        }

        /// <summary>
        /// The last X-index.
        /// </summary>
        int LastX
        { 
            get;
        }

        /// <summary>
        /// The first Y-index.
        /// </summary>
        int FirstY
        { 
            get;
        }

        /// <summary>
        /// The last Y-index.
        /// </summary>
        int LastY
        { 
            get;
        }


        /// <summary>
        /// Item accessor (read only).
        /// </summary>
        /// <param name="y">index of the row.</param>
        /// <param name="x">index of the column.</param>
        /// <returns>desired item.</returns>
        T this[int y, int x]
        {
            get;
        }


        /// <summary>
        /// Count of columns.
        /// Equals to LastX-FirstX+1.
        /// </summary>
        int SizeX
        { 
            get;
        }


        /// <summary>
        /// Count of rows.
        /// Equals to LastY-FirstY+1.
        /// </summary>
        int SizeY
        { 
            get;
        }


    }
}